package com.devops.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.devops.admin.model.DOSHelmChart;
import com.devops.admin.model.DOSHelmChartRepository;
import com.devops.admin.model.TableResult;
import com.devops.admin.po.DOSChartImportPo;
import com.devops.admin.po.DOSChartParamPo;
import com.devops.admin.po.DOSChartPo;
import com.devops.admin.vo.DOSChartParamVo;
import com.devops.admin.vo.DOSPageVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @ClassNem DOSHelmChartService
 * @Description TODO
 * @Author heyabo
 * @Date 2022/3/23 15:10
 * @Version 1.0
 **/
public interface DOSHelmChartService extends IService<DOSHelmChart> {

    /**
     * @Author heyabo
     * @Description 添加chart
     * @Date 15:40 2022/3/23
     * @Param [chart]
     * @return java.lang.Boolean
     **/
    DOSChartParamPo saveChart(DOSHelmChart chart);

    /**
     * @Author heyabo
     * @Description 查询chart列表
     * @Date 15:53 2022/3/23
     * @Param [paramVo]
     * @return com.devops.admin.model.TableResult<com.devops.admin.po.DOSChartParamPo>
     **/
    TableResult<DOSChartParamPo> getCharts(DOSChartParamVo paramVo, DOSPageVo pageVo);

    /**
     * @Author heyabo
     * @Description 更新chart
     * @Date 17:58 2022/3/23
     * @Param [chart]
     * @return java.lang.Boolean
     **/
    Boolean updateChart(DOSHelmChart chart);

    /**
     * @Author heyabo
     * @Description 删除chart
     * @Date 08:49 2022/3/24
     * @Param [chartId]
     * @return java.lang.Boolean
     **/
    Boolean deleteChart(Integer chartId);

    /**
     * @Author heyabo
     * @Description 获取部署的chart
     * @Date 08:53 2022/3/31
     * @Param [projectId]
     * @return java.util.List<com.devops.admin.po.DOSChartPo>
     **/
    List<DOSChartPo> getDeployCharts(Integer projectId);

    /**
     * @Author heyabo
     * @Description 查询环境和仓库级连
     * @Date 10:13 2022/3/31
     * @Param []
     * @return java.util.List<com.devops.admin.po.DOSEnvRepositoryPo>
     **/
    List<DOSHelmChartRepository> getEnvRepositories();

    /**
     * @Author heyabo
     * @Description 上传chart
     * @Date 09:32 2022/4/13
     * @Param [repoName, file]
     * @return void
     **/
    DOSChartImportPo importHelm(MultipartFile file,String chart);
}
